
package ui.adapter;

import android.content.Context;
import android.net.Uri;

import com.facebook.drawee.view.SimpleDraweeView;

import net.ck.hzq.R;

import java.util.ArrayList;
import java.util.List;

import Bean.KnowledgeBean;
import base.BaseViewHolder;
import base.SuperBaseAdapter;


/**
 * 活动专区适配器
 * Created by chenjian on 19/2/27.
 */
public class BasicsAdapter extends SuperBaseAdapter<KnowledgeBean.DataBean.ItemsBean> {

    List<KnowledgeBean.DataBean.ItemsBean> mData = new ArrayList<>();
    Context mContext;

    public BasicsAdapter(Context context, List<KnowledgeBean.DataBean.ItemsBean> data) {
        super(context, data);
        mContext = context;
        mData = data;
    }

    @Override
    protected void convert(BaseViewHolder holder, final KnowledgeBean.DataBean.ItemsBean item, final int position) {
        holder.setText(R.id.listviewknowledge_txt, item.getContent());
        SimpleDraweeView imageView = holder.getView(R.id.listviewknowledge_img);
        imageView.setImageURI(Uri.parse(item.getCourseLevel()));
    }


    @Override
    protected int getItemViewLayoutId(int position, KnowledgeBean.DataBean.ItemsBean item) {
        return R.layout.listview_knowledge_item;
    }

}
